package com.ms.controller;

import com.ms.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class UserController {
    @RequestMapping("/")
    public String index(String name, Integer age, User user){
        System.out.println("user index hui exec...name:"+name+",age:"+age);
        System.out.println("user :"+user);
        return "hui index";
    }

    @RequestMapping(value = "post",method = RequestMethod.POST)
    public String post(String name){
        return "hui post req";
    }

    @RequestMapping(value = "json",method = RequestMethod.POST)
    public String json(@RequestBody String json){
        System.out.println(json);
        return "hui json req";
    }

}
